﻿using System;
using ICommonLibrary.Cocurrent;
using ICommonLibrary.Service;
using Quartz;

namespace ICommonLibrary.Scheduler {

    public interface ISchedulerService : IService {

        ExceptionHandlerDelegate UncaughtExceptionHandler { get; set; }

        IFuture Schedule(Action action, TimeSpan delay);

        IFuture Schedule(Action action, ITrigger trigger);

        IFuture Schedule(Action<object> action, object argument, TimeSpan delay);

        IFuture Schedule(Action<object> action, object argument, ITrigger trigger);

        IFuture ScheduleFixedDelay(Action<CancellationDelegate> action, TimeSpan initialDelay, TimeSpan interval);

        IFuture ScheduleFixedDelay(Action<object, CancellationDelegate> action, object argument, TimeSpan initialDelay, TimeSpan interval);

        IFuture ScheduleFixedPeriod(Action<CancellationDelegate> action, TimeSpan initialDelay, TimeSpan interval);

        IFuture ScheduleFixedPeriod(Action<object, CancellationDelegate> action, object argument, TimeSpan initialDelay, TimeSpan interval);

        void Unschedule(ITrigger trigger);

    }
}